//
//  OCViewController.m
//  2-07-OC网络
//
//  Created by 范英强 on 16/1/25.
//  Copyright © 2016年 范英强. All rights reserved.
//

#import "OCViewController.h"

@interface OCViewController ()

@end

@implementation OCViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //1.初始化url
    NSURL *url = [NSURL URLWithString:@"http://www.weather.com.cn/data/sk/101010100.html"];
    //2.初始化request
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    //3.发送请求
    [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
        //4.序列化
        id result = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
        NSLog(@"--%@",result);
        
        
        
    }] resume];
   
}
@end
